package com.vivien.example.springbootdemo.controller;

import com.vivien.example.springbootdemo.pojo.Claimreport;
import com.vivien.example.springbootdemo.service.ClaimreportService;
import com.vivien.example.springbootdemo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ClaimreportController {
    @Autowired
    ClaimreportService service;

    @GetMapping("claimreport")
    public Result getAll() {
        return new Result(200,"成功",service.getALl());
    }

    @PostMapping("claimreport")
    public Result add(@RequestBody Claimreport claimreport) {
        return new Result(200, "成功", service.addOne(claimreport));
    }
}
